const prodPlugins = []
if (process.env.NODE_ENV === 'production') {
  // prodPlugins.push('transform-remove-console')
}

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins: [
    // 发布产品时候的插件数组
    ...prodPlugins,
    ['import', {
      libraryName: 'vant',
      libraryDirectory: 'es',
      style: true
    }, 'vant'],
    // 添加对可选链操作符的支持
    '@babel/plugin-transform-optional-chaining',
    // 添加对私有类字段的支持
    '@babel/plugin-proposal-private-methods',
    '@babel/plugin-proposal-class-properties',
    '@babel/plugin-proposal-private-property-in-object'
  ]
}
